package com.enjoyor.soa.traffic.ping.efoms.dubbo;

import com.enjoyor.soa.traffic.ping.efoms.pojo.MessagePushEventPojo;
import com.enjoyor.soa.traffic.ping.efoms.pojo.PingResultPojo;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 事件发布端
 * @ClassNameMessagePushListenerImpl
 * @Description TODO
 * @Author ZSY
 * @Date 2019/1/17 10:00
 * @Version 1.0
 **/

@Component
public class ParsePingResultListenerClient implements ParsePingResultListener {

    @Resource
    private ApplicationContext applicationContext;

    /**
     * 发布事件
     */
    @Override
    public void sendResult(PingResultPojo resultPojo) {
        //通过上下文对象发布监听
        applicationContext.publishEvent(new MessagePushEventPojo(this, resultPojo));
    }
}
